<?php
/**
* @version $Id: mod_sobi2customfields.php 5203 2010-12-03 02:45:14Z  $
* @package Joomla 1.5
* @copyright Copyright (C) 2010 Miguel Puig. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
* This is a module to display A Custom fields module for Sobi2
*/

 defined('_JEXEC') or die('Restricted access'); // no direct access ?>

<?php if($show_caroussel==1): ?>

	<script type="text/javascript">
	jQuery(document).ready(function() {
	    jQuery('#carousel_<?php echo $uniqueid; ?>').jcarousel({
	       size: <?php echo count($items_final); ?>,
	       vertical:false,
	       scroll: <?php echo $scrollby; ?>,
	       itemFallbackDimension: <?php echo $item_width; ?>,
	       wrap: 'both'
	
	   
	    });
	});
	</script>
	
<?php endif; ?>

<div class="moduletable<?php echo $class; ?>">

<?php if($show_caroussel==1): ?>
  <ul id="carousel_<?php echo $uniqueid; ?>" class="jcarousel-skin-tango">
<?php else: ?>
  <ul id="carousel_<?php echo $uniqueid; ?>" class="jcarousel-skin-tango">	
<?php endif; ?>  

  <?php $i=0; ?>

	<?php foreach($items_final as $item): ?>

    <li class="sobi2_custom xen" id="item_<?php echo $i;?>">
    
		<?php if(isset($item['image'])):?><span class="sobi2_pro_image"><?php echo $item['image']; ?></span><?php endif; ?><div class="clear"></div>
		<?php if(isset($item['icon'])):?><span class="sobi2_pro_icon"><?php echo $item['icon']; ?></span><?php endif; ?><div class="clear"></div>
		<?php if(isset($item['title'])):?><span class="sobi2_pro_title"><?php echo $item['title']; ?></span><?php endif; ?><div class="clear"></div>
		<?php if(isset($item['fields'])): ?>
			<div class="sobi2fields">
				<?php foreach ($item['fields'] as $field): ?>
					<span class="field_only" id="<?php echo $field['field_id'];?>">
						<?php if($showfieldlabel==1 and $field['value']): ?><span class="title_field"><?php echo $field['field_name']; ?>: </span><?php endif;?>
						<span class="value_field"><?php echo $field['value']; ?></span>
					</span>
				<?php endforeach; ?>
			</div>
		<?php endif;?>
    
    </li>

<?php $i++; ?>
	<?php endforeach; ?>
</ul>

<div class="clear"></div>
</div>